import { createRouter, createWebHistory } from "vue-router";

import routers from "@/router/router";

// 公共路由
export const constantRoutes = routers

// 动态路由，基于用户权限动态去加载
export const dynamicRoutes = [
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes: constantRoutes,
    // 路由跳转时，页面始终滚动到顶部
    scrollBehavior() {
        // 始终滚动到顶部
        return { top: 0 }
    },
});



export default router

